﻿using System;

namespace PoolKit
{
    /// <summary>
    /// A dummy strategy for use with resources that don't support repairing
    /// </summary>
    /// <typeparam name="TResource"></typeparam>
    public class RepairStrategyNotSupportingRepairs<TResource> : RepairStrategy<TResource>
    {
        public override ThreadingContract ThreadingContract
        {
            get { return ThreadingContract.Multithreaded; }
        }

        /// <summary>
        /// Repairs a broken resource or creates a replacement for it
        /// </summary>
        /// <param name="resource">Resource to repair</param>
        /// <returns>Repaired resource or a replacement for it</returns>
        public override TResource Repair(TResource resource)
        {
            throw new NotSupportedException("Repairing resources is not supported.");
        }
    }
}